﻿//
// Copyright (c) 2024 BPer
//
#ifndef BPERMEETING_INCLUDE_BPERPLAYERHANDLE_H_
#define BPERMEETING_INCLUDE_BPERPLAYERHANDLE_H_
#include <bperplayer/BPerPlayerHandle.h>
#include <bperplayer/BPerPlayerBase.h>

#include <bperstream/BPerSynBuffer.h>
#include <bperutil/BPerAvInfoType.h>
#include <bperutil/sys/BPerUrl.h>

#include "BPerRtcReceive.h"


class BPerPlayerHandleImpl :public BPerPlayerHandle{
public:
	BPerPlayerHandleImpl(BPerContext* pcontext,BPerSysMessageI* pmessage);
	virtual ~BPerPlayerHandleImpl();
	BPerVideoBuffer* getVideoBuffer();
	int play(char* url);
    int32_t playRtc(int32_t puid,char* url);
	int32_t playRtc(int32_t puid,char* localIp, char* server, int32_t pport,char* app,char* stream);
	void stopPlay();
protected:

	BPerUrlData m_url;
	void initList();
	//BPerPlayReceive *m_recv;
	BPerPlayerBase *m_play;
	BPerRtcReceive *m_rtcRecv;

private:
	BPerContext* m_context;
	BPerVideoDecoderBuffer* m_outVideoBuffer;
	BPerAudioEncoderBuffer* m_outAudioBuffer;
	BPerSysMessageI* m_message;
};

#endif /* BPERMEETING_INCLUDE_BPERPLAYERHANDLE_H_ */
